package com.service;

import com.baseEnum.SettingEnums;

import java.awt.image.BufferedImage;

/**
 * @Author ri.yang
 * @Since 2016/1/6.
 */
public interface ICaptchaService {
    /**
     * 生成验证码图片
     *
     * @param captchaId 验证ID
     * @return 验证码图片
     */
    BufferedImage buildImage(String captchaId);

    /**
     * 验证码验证
     *
     * @param captchaType 验证码类型
     * @param captchaId   验证ID
     * @param captcha     验证码(忽略大小写)
     * @return 验证码验证是否通过
     */
    boolean isValid(SettingEnums.CaptchaType captchaType, String captchaId, String captcha);

}
